home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _FIXCURS.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  86 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__fixcurs = "$Header: c:/curses/private/RCS/_fixcurs.c%v 2.0 1992/11/15 03:24:21 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_fix_cursor()     - Fix the cursor start and stop scan lines (if necessary)
  14.  
  15.   PDCurses Description:
  16.        This is a private PDCurses routine.
  17.  
  18.        This routine will fix the cursor shape for certain video adapters.
  19.        Normally, the values used are correct, but some adapters choke.
  20.        The most noticable choke is on a monochrome adapter.  The "correct"
  21.        scan lines will result in the cursor being set in the middle of the
  22.        character cell, rather than at the bottom.
  23.  
  24.        The passed flag indicates whether the cursor is visible or not.
  25.  
  26.        This only applies to the DOS platform.
  27.  
  28.   PDCurses Return Value:
  29.        This function returns OK on success and ERR on error.
  30.  
  31.   PDCurses Errors:
  32.        No errors are defined for this function.
  33.  
  34.   Portability:
  35.        PDCurses        int PDC_fix_cursor( int flag );
  36.  
  37. **man-end**********************************************************************/
  38.  
  39. int    PDC_fix_cursor(int flag)
  40. {
  41. #ifdef FLEXOS
  42.        return( OK );
  43. #endif
  44. #ifdef DOS
  45.        char far*       INFO = (char far *) 0x0487L;
  46.  
  47.        if (_cursvar.bogus_adapter)
  48.                return( OK );
  49.  
  50.        switch (_cursvar.adapter)
  51.        {
  52.        case _EGACOLOR:
  53.        case _EGAMONO:
  54.        case _MDS_GENIUS:               /* Some clones look like a Genius;-)  */
  55.                if (flag & 0x01)
  56.                        *INFO |= 0x01;                  /* Enable  emnulation */
  57.                else
  58.                        *INFO &= (*INFO & ~0x01);       /* Disable emnulation */
  59.                break;
  60.  
  61.        case _VGACOLOR:
  62.        case _VGAMONO:
  63.                if (flag & 0x01)
  64.                        regs.x.ax = 0x1200;             /* Enable  emulation */
  65.                else
  66.                        regs.x.ax = 0x1201;             /* Disable emulation */
  67.                regs.h.bl = 0x34;
  68.                int86(0x10, ®s, ®s);
  69.  
  70.                break;
  71.  
  72.        case _MCGACOLOR:
  73.        case _MCGAMONO:
  74.        case _MDA:
  75.        case _CGA:
  76.        case _NONE:
  77.        default:
  78.                break;
  79.        }
  80.        return( OK );
  81. #endif
  82. #ifdef     OS2
  83.         return( OK );
  84. #endif
  85. }
  86.